Skip to content

provided more information to plugin authors #2605

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 16, 2017

Conversation

Plamen5kov
Copy link
Contributor

Problem:
Plugin authors do unnecessary changes, because they lack the information about files about to be synced. This workflow causes too much trouble, which can be easily avoided if cli provides more information to the plugin authors, who will then be able to handle the erroneous behavior.

Solution:
Introduced hookArgs.filesToSync parameter which contains all changed files as a string array. If no files are marked as changed filesToSync is undefined.

Plugin authors needed more information on what files have changed during livesync and we now provide this information through hookArgs.filesToSync, which is a string array full with all detected changed files. hookArgs is a parameter of the before-(after)-prepare-hook.js files, that gets resolved by an injector.

plugin authors needed more information on what files have changed during livesync
we no provide this information through hookArgs.filesToSync, which is a string array full with all detected changed files
Copy link
Contributor

@rosen-vladimirov rosen-vladimirov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@@ -257,7 +257,7 @@ export class PlatformService extends EventEmitter implements IPlatformService {
}

@helpers.hook('prepare')
private async preparePlatformCore(platform: string, appFilesUpdaterOptions: IAppFilesUpdaterOptions, projectData: IProjectData, platformSpecificData: IPlatformSpecificData, changesInfo?: IProjectChangesInfo): Promise<void> {
private async preparePlatformCore(platform: string, appFilesUpdaterOptions: IAppFilesUpdaterOptions, projectData: IProjectData, platformSpecificData: IPlatformSpecificData, changesInfo?: IProjectChangesInfo, filesToSync?: Array<String>): Promise<void> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please add a comment above that filesToSync is expected to be used in the hooks, as next time when I see this code, I'll notice that no one is using the non-mandatory parameter and I'll delete it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

@Plamen5kov Plamen5kov merged commit 31781bb into master Mar 16, 2017
@Plamen5kov Plamen5kov deleted the plamen5kov/augmented_hook_args branch March 17, 2017 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants